package com.ui.basic.command.administrative;

import java.util.Date;
import java.util.List;

import org.springmodules.validation.bean.conf.loader.annotation.handler.Email;
import org.springmodules.validation.bean.conf.loader.annotation.handler.InThePast;
import org.springmodules.validation.bean.conf.loader.annotation.handler.Length;
import org.springmodules.validation.bean.conf.loader.annotation.handler.NotBlank;
import org.springmodules.validation.bean.conf.loader.annotation.handler.NotNull;

import com.common.basic.base.BaseCommand;
import com.common.basic.util.ComboValue;
import com.ui.basic.ibatis.model.admin.TblACustomer;

public class CommandCustomer extends BaseCommand implements
		java.io.Serializable {

	private static final long serialVersionUID = 5819074256415779495L;

	private Long id;
	@NotBlank
	@Length(max = 35)
	private String firstname;
	@Length(max = 35)
	private String surname;
	@InThePast
	private Date dob = new Date();
	@Length(max = 15)
	private String homephone;
	@Length(max = 15)
	private String workphone;
	@Length(max = 15)
	private String mobile;
	@Length(max = 170)
	@Email(applyIf = "email1 is not blank")
	private String email1;
	@Length(max = 170)
	@Email(applyIf = "email2 is not blank")
	private String email2;
	@NotBlank
	@Length(max = 70)
	private String address1;
	@Length(max = 70)
	private String address2;
	@NotBlank
	@Length(max = 50)
	private String suburb;
	@NotBlank
	@Length(max = 6)
	private String postalCode;
	@NotBlank
	@Length(max = 50)
	private String state;
	@NotNull
	private Long countryId;
	private List<ComboValue> countryList;
	@NotNull
	private Long identificationId;
	private List<ComboValue> identityList;

	@Length(max = 50)
	private String idnumber;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public Date getDob() {
		return dob;
	}

	public void setDob(Date dob) {
		this.dob = dob;
	}

	public String getHomephone() {
		return homephone;
	}

	public void setHomephone(String homephone) {
		this.homephone = homephone;
	}

	public String getWorkphone() {
		return workphone;
	}

	public void setWorkphone(String workphone) {
		this.workphone = workphone;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail1() {
		return email1;
	}

	public void setEmail1(String email1) {
		this.email1 = email1;
	}

	public String getEmail2() {
		return email2;
	}

	public void setEmail2(String email2) {
		this.email2 = email2;
	}

	public String getAddress1() {
		return address1;
	}

	public void setAddress1(String address1) {
		this.address1 = address1;
	}

	public String getAddress2() {
		return address2;
	}

	public void setAddress2(String address2) {
		this.address2 = address2;
	}

	public String getSuburb() {
		return suburb;
	}

	public void setSuburb(String suburb) {
		this.suburb = suburb;
	}

	public String getPostalCode() {
		return postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public Long getCountryId() {
		return countryId;
	}

	public void setCountryId(Long countryId) {
		this.countryId = countryId;
	}

	public Long getIdentificationId() {
		return identificationId;
	}

	public void setIdentificationId(Long identificationId) {
		this.identificationId = identificationId;
	}

	public String getIdnumber() {
		return idnumber;
	}

	public void setIdnumber(String idnumber) {
		this.idnumber = idnumber;
	}

	public void setProperty(TblACustomer entity) {
		this.id = entity.getId();
		this.firstname = entity.getFirstname();
		this.surname = entity.getSurname();
		this.dob = entity.getDob();
		this.address1 = entity.getAddress1();
		this.address2 = entity.getAddress2();
		this.suburb = entity.getSuburb();
		this.postalCode = entity.getPostalCode();
		this.state = entity.getState();
		this.countryId = entity.getCountryId();
		this.email1 = entity.getEmail1();
		this.email2 = entity.getEmail2();
		this.homephone = entity.getHomephone();
		this.workphone = entity.getWorkphone();
		this.mobile = entity.getMobile();
		this.idnumber = entity.getIdnumber();
		this.identificationId = entity.getIdentificationId();
	}

	public List<ComboValue> getCountryList() {
		return countryList;
	}

	public void setCountryList(List<ComboValue> countryList) {
		this.countryList = countryList;
	}

	public List<ComboValue> getIdentityList() {
		return identityList;
	}

	public void setIdentityList(List<ComboValue> identityList) {
		this.identityList = identityList;
	}

}